package com.service;

import com.activity.MyMapActivity;
import com.commun.Param;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.preference.PreferenceManager;

public class MyStartupIntentReceiver extends BroadcastReceiver {
	@Override
	public void onReceive(Context context, Intent intent) {

		if (PreferenceManager.getDefaultSharedPreferences(
				MyMapActivity.getmContext()).getString(
				Param.PREF_SERVICE_TIMER_LAUNCHED, Param.STATE_DISABLED).equals(Param.STATE_ENABLED)) {
			Intent serviceIntent = new Intent();
			serviceIntent.setAction("com.wissen.startatboot.LocalServiceTimer");
			context.startService(serviceIntent);
		}
		if (PreferenceManager.getDefaultSharedPreferences(
				MyMapActivity.getmContext()).getString(
				Param.PREF_SERVICE_SILENT_LAUNCHED, Param.STATE_DISABLED).equals(Param.STATE_ENABLED)) {
			Intent serviceIntent = new Intent();
			serviceIntent.setAction("com.wissen.startatboot.SilentService");
			context.startService(serviceIntent);
		}
	}
}